package com.wu.framework.oauth.controller;

import com.wu.framework.Result;
import com.wu.framework.ResultFactory;
import com.wu.framework.oauth.domain.entity.OauthClientDetails;
import com.wu.framework.oauth.servie.OauthClientDetailsService;
import com.wu.framework.inner.layer.web.EasyController;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * description
 *
 * @author 吴佳伟
 * @date 2021/5/26 4:11 下午
 */
@EasyController("/oauth2")
public class Oauth2Controller {

    private OauthClientDetailsService oauthClientDetailsService;

    public Oauth2Controller(OauthClientDetailsService oauthClientDetailsService) {
        this.oauthClientDetailsService = oauthClientDetailsService;
    }

    @PostMapping(value = "/oauthClientDetails/save/")
    public Result saveOauthClientDetails(@RequestBody OauthClientDetails oauthClientDetails) {
        return ResultFactory.successOf(oauthClientDetailsService.saveOauthClientDetails(oauthClientDetails));
    }
}
